Bulk creation of vehicles

This request allows you to create multiple vehicles at once by entering their data in the request body.

Request syntax

POST https://b2b-api.go.yandex.ru/integration/2.0/vehicles/bulk-create

Request headers

  • Authorization: Bearer <OAuth-token>
    OAuth access token. The steps to get a token are described in Getting started.
  • X-YaTaxi-Selected-Corp-Client-Id — client ID from the account. Required if multiple clients are available using the token.
  • X-Idempotency-Token — idempotency token, a string using UUID format. One idempotency token corresponds to one order; a new order requires generating a new token. Required header.

Request body

Data is transmitted in JSON format:

Field Description Format Required
vehicles Array of vehicle descriptions. Array Yes

Structure of the vehicles array element:

Field Description Format Required
license_plate Vehicle license plate number. String Yes
model Vehicle model. String Yes
limit_id Refuel limit ID. String Yes
access_type Access type Possible values: anyone or custom. String Yes
access Array of access rights. Array No

Structure of the access array element:

Field Description Format Required
entity_type Access subject type. Possible values: user, department. String Yes
entity_id User or department ID. String Yes

Response field description

Returns a list of created vehicle IDs.

Field Description Format
items Array of objects with vehicle_id. Array
vehicle_id Unique vehicle ID. String

Request example

POST https://b2b-api.go.yandex.ru/integration/2.0/vehicles/bulk-create
Authorization: Bearer <OAuth token>
X-YaTaxi-Selected-Corp-Client-Id: <client-id><client-id>
X-Idempotency-Token: <token>

  { 
    "vehicles": [
      {
        "license_plate": "Е768КК58",
        "model": "Haval-5",
        "limit_id": "7715b67....c9b0d4b6",
        "access_type": "custom",
        "access": [
          {            
            "entity_type": "department",
            "entity_id": "6ddfc4...ec77b135f"
          }
        ]
      }
    ]
  }

Response example

{
  "ids": [
    "4cd981dc5....805500202"
  ]
}

Possible response codes

  • 200 — created
  • 400 — error validating parameters
  • 404 — client not found
  • 409 — conflict (for example, duplicate vehicle license plate number)
  • 503 — temporary server error